package day01;

import java.sql.SQLOutput;

/**
 * @author Jetwang
 * @version 1.0
 * @since 2023/3/18 16:50
 */
public class PriorityQueueTest {
    public static void main(String[] args) {
        PriorityQueue<Entry> queue = new PriorityQueue<>(5);

        queue.offer(new Entry("task01", 4));
        queue.offer(new Entry("task02", 3));
        queue.offer(new Entry("task03", 2));
        queue.offer(new Entry("task04", 5));
        queue.offer(new Entry("task05", 1));

        queue.forEach(System.out::println);

        System.out.println("==========");
        System.out.println(queue.poll().priority);
        System.out.println(queue.poll().priority);
        System.out.println(queue.poll().priority);
        System.out.println(queue.poll().priority);
        System.out.println(queue.poll().priority);
    }
}
